﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/TravelIndex.master" CodeBehind="AdministrarServicios.aspx.vb" Inherits="CondorTravel.AdministrarServicios" %>
<asp:Content ID="Content1" ContentPlaceHolderID="contenidoModulo" runat="server">
    
    <script>
        var ventana_secundaria 
        var ventana_secundaria1

        var nav4 = window.Event ? true : false;
        function IsNumber(evt) {
            // Backspace = 8, Enter = 13, ’0′ = 48, ’9′ = 57, ‘.’ = 46
            var key = nav4 ? evt.which : evt.keyCode;
            return (key <= 13 || (key >= 48 && key <= 57) || key == 46);
        }
 
        function abrirVentanaBuscar() {
            //guardo la referencia de la ventana para poder utilizarla luego 
            ventana_secundaria1 = window.showModalDialog("../Servicios/BuscarSolicitudServicio.aspx", "miventana", "width=800,height=310,menubar=no")
//            document.getElementById('<%=txtCodSolicitud.ClientID%>').value = ventana_secundaria1
            __doPostBack("MiFuncionServicios", ""); 

        }

        function abrirVentanaPRV() {
            //guardo la referencia de la ventana para poder utilizarla luego 
            ventana_secundaria1 = window.showModalDialog("../Servicios/BuscarProveedor.aspx", "miventana", "dialogwidth=1,dialogheight=1, menubar=no")
//            document.getElementById('<%=txtCodProveedor.ClientID%>').value = ventana_secundaria1
            __doPostBack("MiFuncion", ""); 

        }


        function cerrarVentana() {
            //la referencia de la ventana es el objeto window del popup. Lo utilizo para acceder al método close
            ventana_secundaria.close()
        }

        function cerrarVentanaPrv() {
            //la referencia de la ventana es el objeto window del popup. Lo utilizo para acceder al método close
            ventana_secundaria1.close()
        } 


    </script>
    
    <form name="frmAdministrarServicios" method="post" id="frmAdministrarServicios">

<div class="subtitulo" style="font-size: large"><asp:label ID="lblTitulo" runat="server"></asp:label></div>
	
	<table style="WIDTH: 92%" cellspacing="0" cellpadding="0" border="0">
	<tbody>
		<tr class="TRlist3">
			<td colspan="4">&nbsp;</td>
		</tr>
		<tr class="TRlist3">
			<td style="WIDTH: 121px">Solicitud: </td>
			<td colspan="2" >
				 <asp:TextBox ID="txtCodSolicitud" runat="server" Width="70px" MaxLength="5" 
                     Enabled="False" ></asp:TextBox>
            &nbsp;<a id="A1" href="#" style="font-weight:bold;"><img src="../../res/img/search.gif" border="0"  onclick ="abrirVentanaBuscar();"/></a><asp:TextBox ID="txtDescripcion" runat="server" Width="356px" Enabled="False"></asp:TextBox>
            </td>
            <td style="HEIGHT: 16px">
                &nbsp;</td>			    
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px; HEIGHT: 24px">Nombre Servicio</td>
			<td  >               
				<asp:TextBox ID="txtNombreServicio" runat="server" Width="356px" MaxLength="50"></asp:TextBox>
            &nbsp;</td>
			<td>&nbsp;</td>
			<td>
            &nbsp;</td>
		</tr>
		<tr class="TRlist3">
			<td style="WIDTH: 98px; HEIGHT: 24px">Tipo Servicio</td>
			<td  >               
                <asp:DropDownList ID="cboTipoServicio" runat="server" Height="16px" 
                    Width="120px">
                </asp:DropDownList>
            </td>
			<td>&nbsp;</td>
			<td>
                &nbsp;</td>
		</tr>
		<tr class="TRlist3">
			<td style="WIDTH: 98px">Unidad</td>
			<td style="WIDTH: 270px">
                <asp:DropDownList ID="cboUnidad" runat="server" Height="16px" Width="120px">
                </asp:DropDownList>
            &nbsp;</td>
			<td>&nbsp;</td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">Proveedores de Solicitud:</td>
			<td style="WIDTH: 270px">
            <asp:TextBox ID="txtProveedorSolicitud" runat="server" Width="318px" Enabled="False" 
                Height="54px"></asp:TextBox>
            </td>
			<td>&nbsp;</td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">&nbsp;</td>
			<td style="WIDTH: 270px">
                &nbsp;</td>
			<td>&nbsp;</td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td style="background-color: #666666;" align="center" bgcolor="#666666" 
                colspan="4">
            <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="Small" 
                ForeColor="White" Text="Proveedor por Zona de Distribución"></asp:Label>
            </td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">&nbsp;</td>
			<td style="WIDTH: 270px">
                &nbsp;</td>
			<td>&nbsp;</td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">Pais:
				</td>
			<td style="WIDTH: 270px">
				<asp:DropDownList ID="cboPais" runat="server" Height="16px" Width="220px" 
                AutoPostBack="True">
                </asp:DropDownList>
            </td>
			<td>&nbsp;</td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">Ciudad:</td>
			<td style="WIDTH: 270px">
				<asp:DropDownList ID="cboCiudad" runat="server" Height="16px" Width="220px">
                </asp:DropDownList>
            </td>
			<td>&nbsp;</td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">Proveedor:&nbsp;&nbsp;</td>
			<td colspan="3">
				 <asp:TextBox ID="txtCodProveedor" runat="server" Width="96px" Enabled="False"></asp:TextBox>
				<a id="A2" href="#" style="font-weight:bold;">
				<img src="../../res/img/search.gif" border="0"  
                onclick ="abrirVentanaPRV();" style="height: 16px" id="imgProveedor"/></a>               
				<asp:TextBox ID="txtRazonSocial" runat="server" Width="628px" Enabled="False"></asp:TextBox>
            </td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px; height: 29px;">Tipo de Tarifa: </td>
			<td style="WIDTH: 270px; height: 29px;">
                <asp:DropDownList ID="cboTarifa" runat="server" Height="16px" Width="120px">
                </asp:DropDownList>
            </td>
			<td style="height: 29px"></td>
            <td style="height: 29px"></td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">Tarifa:</td>
			<td style="WIDTH: 270px">
				 <asp:TextBox ID="txtTarifa" runat="server" Width="68px" MaxLength="9"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtTarifa" 
                     ErrorMessage="Solo Números (Enteros o decimales) (,)" ForeColor="#FF3300" 
                    ValidationExpression="^[0-9]{1,5}(\,[0-9]{0,2})?$"></asp:RegularExpressionValidator>
            </td>
			<td>
                  <asp:Button ID="btnAgregar" class="graybutton" runat="server" Text="Agregar" 
                    Width="79px" />
            &nbsp;&nbsp;
                  <asp:Button ID="btnCancelar" class="graybutton" runat="server" Text="Cancelar" 
                    Width="79px" />
            </td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td style="background-color: #999999;" colspan="4">
				 <asp:TextBox ID="txtCodDistribucion" runat="server" Width="96px" 
                    Enabled="False" Height="16px" Visible="False"></asp:TextBox>
				</td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">&nbsp;</td>
			<td style="WIDTH: 270px">
                &nbsp;</td>
			<td>&nbsp;</td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td colspan="4">
    <asp:GridView ID="dgDistribucion" runat="server" 
        AutoGenerateColumns="False" style="margin-top: 0px" Width="901px">
        <Columns>
            <asp:BoundField DataField="CodTarifaServProv" HeaderText="CodTarifaServProv" 
                SortExpression="CodTarifaServProv">
            <HeaderStyle Width="5px" />
            </asp:BoundField>
            <asp:BoundField DataField="codPais" HeaderText="CodPais" 
                SortExpression="codPais" />
            <asp:BoundField DataField="descripcionPais" HeaderText="Pais" 
                SortExpression="desPais" />
            <asp:BoundField HeaderText="CodCiudad" DataField="codCiudad" 
                SortExpression="codCiudad" />
            <asp:BoundField DataField="descripcionCiudad" HeaderText="Ciudad" 
                SortExpression="desCiudad" />
            <asp:BoundField DataField="codProveedor" HeaderText="CodProveedor" 
                SortExpression="codProveedor" />
            <asp:BoundField DataField="DesProveedor" HeaderText="Proveedor" 
                SortExpression="nombProveedor" />
            <asp:BoundField DataField="codTipoTarifa" HeaderText="codTipoTarifa" />
            <asp:BoundField DataField="DescTipoTarifa" HeaderText="TipoTarifa" 
                SortExpression="tipoTarifa" />
            <asp:BoundField DataField="Tarifa" HeaderText="Tarifa" 
                SortExpression="Tarifa" />
            <asp:BoundField DataField="EstadoTarServProv" HeaderText="EstadoTarServProv" 
                Visible="False" />
          
             <asp:TemplateField HeaderText="EditarTarifa">
                <ItemTemplate>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                         <asp:ImageButton ID="ImagenEditar" runat="server" 
                        CommandArgument='<%#Eval("CodTarifaServProv")%>' 
                        CommandName="Editar" Height="19px" ImageUrl="~/res/img/icono_editar.gif" 
                        Width="16px" />
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Eliminar">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:ImageButton ID="imgEliminar" runat="server" 
                        CommandArgument='<%#Eval("codPais").toString + "|" + Eval("codCiudad").toString + "|" + Eval("codProveedor").toString + "|" + Eval("DescTipoTarifa").toString + "|" + Eval("Tarifa").toString + "|" + Eval("EstadoTarServProv").toString  %> ' 
                        CommandName="Eliminar" Height="19px" ImageUrl="~/res/img/icono_eliminar.gif" 
                        Width="16px" />
                    <asp:ConfirmButtonExtender TargetControlID="imgEliminar" ID="confBtnDelete"  
                        ConfirmText="¿Esta seguro que desea eliminar?" runat="server">
                    </asp:ConfirmButtonExtender>
                </ItemTemplate>
            </asp:TemplateField>



        </Columns>
    </asp:GridView>
            </td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">&nbsp;</td>
			<td style="WIDTH: 270px">
                &nbsp;</td>
			<td>&nbsp;</td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">&nbsp;</td>
			<td style="WIDTH: 270px">
                  <asp:Button ID="btnGrabar" class="graybutton" runat="server" Text="Grabar" 
                    Width="118px" />
            </td>
			<td><asp:Button ID="btnRegresar" runat="server"
                    Text="Regresar"  PostBackUrl="../Servicios/ConsultarServicios.aspx" 
                    Width="94px"  class="graybutton"   /></td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">&nbsp;</td>
			<td style="WIDTH: 270px">
                &nbsp;</td>
			<td>&nbsp;</td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">&nbsp;</td>
			<td style="WIDTH: 270px">
                &nbsp;</td>
			<td>&nbsp;</td>
            <td>&nbsp;</td>
		</tr>		
		<tr class="TRlist3">
			<td colspan="4">
    <asp:Label ID="lblMensaje" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
            </td>
		</tr>		
		<tr class="TRlist3">
			<td style="WIDTH: 98px">&nbsp;</td>
			<td style="WIDTH: 270px">
                &nbsp;</td>
			<td>&nbsp;</td>
            <td>&nbsp;</td>
		</tr>		
		
	</tbody>
	</table>
</form>
</asp:Content>
